/* 
 * File:   entity_html_viewer.cpp
 * Author: jolo
 * 
 * Created on: 12. Oktober 2011, 07:23
 * Lincense: New BSD License (The BSD 2-Clause License)
 */

#include "entity_html_viewer.hpp"

#include <model/entity.hpp>
#include <model/repository.hpp>
#include <model/project.hpp>
#include <model/chemical_element.hpp>

#include <tools/entity_formatter.hpp>

namespace widgets
{

    entity_html_viewer::entity_html_viewer(QWidget* p)
    : QWebView(p),
            f_(tools::entity_formatter_ptr(new tools::entity_formatter()))
    {
    }

    entity_html_viewer::~entity_html_viewer()
    {
    }
    
    void entity_html_viewer::on_show_request(model::entity_ptr e) {
        setHtml(f_->format(e).c_str());
    }
}